<?php
/**
 * Created by PhpStorm.
 * @author WYZ <wyz@jungo.com.cn>
 * @copyright 深圳市俊网网络有限公司
 */

namespace Selibra\ORM\Annotations;

use Selibra\Di\AnnotationConfigure;
use Selibra\Di\AnnotationExecEntity;
use Selibra\Di\Annotations\Protocol\SelibraAnnotationInterface;
use Selibra\ORM\EntityCollector;
use \Attribute;

/**
 * Class Entity
 * @package Selibra\ORM\Annotations
 */
#[Attribute(Attribute::TARGET_CLASS)]
class Entity implements SelibraAnnotationInterface
{

    protected string $entityClass = '';

    public function __construct($entityClass)
    {
        $this->entityClass = $entityClass;
    }

    /**
     * @inheritDoc
     */
    public function exec(AnnotationExecEntity &$annotationExecEntity)
    {
        EntityCollector::add($annotationExecEntity->getClass(),$this->entityClass);
    }

    /**
     * @inheritDoc
     */
    public function configure(AnnotationConfigure $annotationConfigure)
    {
        // TODO: Implement configure() method.
    }
}